﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using OgilvyOne.DALFactory;
using OgilvyOne.Utility;

namespace OgilvyOne.BLL
{
    /// <summary>
    /// 列表标签,循环替换标签内容
    /// <cms:sqllist value="查询SQL,返回DateSet">
    ///     循环列表数据<cms value="DataSet字段名"/>
    /// </sqllist>
    /// </summary>
    class SqlListLabel : ListLabel
    {
        //sql 
        private string sqlstr;

        public SqlListLabel(CommonModel model)
            : base(model)
        {

        }
        public string Sqlstr
        {
            set { sqlstr = value.ToLower().Replace("delete","").Replace("update","").Replace("dorp",""); }
        }

        protected override object Execute()
        {
            return CmsArticleFrontFactory.create().GetSqlTable(sqlstr); ;
        }
    }
}
